package com.mt.order.controller;

import com.mt.common.PagerInfo;
import com.mt.common.ServiceResult;
import com.mt.order.api.service.IOrderService;
import com.mt.order.entity.OrderEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
public class OrderController {
    @Autowired
    IOrderService orderService;


    @PostMapping("/order/doInsertList")
    public ServiceResult<List<OrderEntity>> doInsertList(List<OrderEntity> orderEntityList) {
        return orderService.doInsertList(orderEntityList);
    }

    @GetMapping("/order/findInfo")
    public ServiceResult<OrderEntity> findInfo(Map<String, Object> params) {
        return orderService.findInfo(params);
    }

    @GetMapping("/order/findList")
    public ServiceResult<List<OrderEntity>> findList(Map<String, Object> params, PagerInfo<?> pagerInfo) {
        return orderService.findList(params, pagerInfo);
    }

    @PostMapping("/order/doUpdate")
    public void doUpdate(OrderEntity orderEntity) {
        orderService.doUpdate(orderEntity);
    }
}
